#include <iostream>
#include <cmath>
#include <iomanip>
#include <cstring>

using namespace std;

class CDate
{
private:
    int year, month, day;

public:
    CDate()
    {
        year = 0;
        month = 0;
        year = 0;
    }
    CDate(int year, int month, int day)
    {
        this->year = year;
        this->month = month;
        this->day = day;
    }
    CDate(CDate &s)
    {
        s.day = day;
        s.month = month;
        s.year = year;
    }
    int getYear()
    {
        return year;
    }
    int getMonth()
    {
        return month;
    }
    int getDay()
    {
        return day;
    }
    void print()
    {
        cout << "停机日期=" << year << '.' << month << '.' << day << endl;
    }
};

class Phone
{
private:
    char num[20];
    char type;
    int state;
    CDate *date;

public:
    Phone(char type, char num[], int state)
    {
        this->type = type;
        this->state = state;
        strcpy(this->num, num);
        //date = NULL;
        cout << "Construct a new phone " << num << endl;
    }
    Phone(Phone &s)
    {
        type = 'D';
        state = s.state;
        date = NULL;
        if (s.date != NULL)
        {
            date = new CDate(*s.date);
        }
        strcpy(num, s.num);
        cout << "Construct a copy of phone " << num << endl;
        *(num + 11) = 'X';
        *(num + 12) = '\0';
    }
    void stop(CDate &s)
    {
        state = 3;
        date = new CDate(s.getYear(), s.getMonth(), s.getDay());
        cout << "Stop the phone " << num << endl;
    }
    string getType()
    {
        switch (type)
        {
        case 'A':
            return "机构";
        case 'B':
            return "企业";
        case 'C':
            return "个人";
        case 'D':
            return "备份";
        default:
            return "error";
        }
    }
    string getState()
    {
        switch (state)
        {
        case 1:
            return "在用";
        case 2:
            return "未用";
        case 3:
            return "停用";
        default:
            return "error";
        }
    }
    void print()
    {
        // cout << "Construct a new phone " << num<<endl;
        cout << "类型=" << getType() << "||号码=" << num << "||State=" << getState();

        if (state == 3)
        {
            cout << " ||";
            date->print();
            cout << "----" << endl;
        }
        else
        {
            cout << endl;
        }
    }
    ~Phone()
    {
        if (date != NULL)
            delete date;
    }
};
int main()
{
    int t, y, m, d, state;
    char type, num[15];
    cin >> t;
    while (t--)
    {
        cin >> type >> num >> state >> y >> m >> d;
        CDate date(y, m, d);
        Phone s(type, num, state);
        s.print();
        Phone s2(s);
        s2.print();
        s.stop(date);
        s.print();
    }
    // cout << endl;
    return 0;
}

/*

*/